package com.phillong.factory.simplefactory;
import com.phillong.factory.simplefactory.pojo.CheesePizza;
import com.phillong.factory.simplefactory.pojo.PepperoniPizza;
import com.phillong.factory.simplefactory.pojo.VeggiePizza;

/**
 * @author zhangpeng
 */
public class SimplePizzaFactory {

    public Pizza createPizza(String type){
        Pizza pizza = null;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        }
        if (type.equals("pepperoni")){
            pizza = new PepperoniPizza();
        }
        if (type.equals("veggie")){
            pizza = new VeggiePizza();
        }
        return pizza;
    }
}
